<template>
  <div class="empty" v-if="show">
    <img :src="empty">
    <div v-if="!text">暂无相关记录</div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: ['show', 'text'],
  data () {
    return {
      empty: require('@/assets/images/empty.png')
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../assets/css/config';
@import '../assets/css/mixins';
.empty {
  padding-top: 0.2rem;
  color: #999;
  text-align: center;
  font-size: 0.24rem;
  img {
    display: block;
    width: 3rem;
    margin: 0.5rem auto 0.6rem;
  }
}
</style>
